package router

import (
	"github.com/gin-gonic/gin"
	"weibo/handler/service"
)

func Router() *gin.Engine {
	r := gin.Default()
	userApi := r.Group("/api/user")
	{
		userApi.Group("user", service.User)
	}
	weiboApi := r.Group("/api/weibo")
	{
		weiboApi.POST("/addPost", service.AddPost)
		weiboApi.POST("/ossUpload", service.OssUpload)
	}
	topicApi := r.Group("/api/topic")
	{
		topicApi.POST("topic", service.Topic)
	}
	searchApi := r.Group("/api/search")
	{
		searchApi.GET("getFriendPost", service.GetFriendPost)
		searchApi.GET("getMyPost", service.GetMyPost)
		searchApi.GET("getPost", service.GetPost)
		searchApi.GET("delPost", service.DelPost)
	}
	return r
}
